<?php include_once("../../../common/common_setting_unit.php");         // 引入通用的设置文件 ?>
<?php include_once(ROOT_PATH_ . "/controller/common/module/head.php"); // 引入通用的头部 ?>
<?php include_once("../controller/data_add.php");
?>


<body>

<!--顶部栏-->
<div id="topbar"> <?php include ROOT_PATH_ . '/controller/common/module/topbar.php'; ?></div>

<!--容器-->
<div id="container" class="<? echo $now_extender ?>">

    <!--侧边栏-->
    <div id="sidebar"><?php include ROOT_PATH_ . '/controller/common/module/sidebar.php'; ?></div>





    <?
    //==============================================================================
    //这里开始才是平常开发需要注重的部分，其余的基本不用理会
    //==============================================================================
    ?>


		<div id="content" class="layui-form">
			<?php $page_title='部门添加';?>
<fieldset class="layui-elem-field layui-field-title">
                <legend> <?php echo $page_title;?> </legend>
            </fieldset>


            <div class="detail-box">
     			<div class="box department-add-box layui-form">

       				<div class="content_area dishes_box">



<form id="add-department-form" method="post"
      action="detail-add-function.php?now_extender=department"
      enctype="multipart/form-data" class="layui-form">

  <div class="layui-form-item">
    <label class="layui-form-label">部门名称</label>
    <div class="layui-input-block">
      <input type="text" name="name" required  lay-verify="required" placeholder="请输入名字" autocomplete="off" class="layui-input">
    </div>
  </div>
	

    <div class="layui-form-item">
        <label class="layui-form-label">上一级所属部门</label>
        <div class="layui-input-block">
          <select name="parent_id" lay-verify="required">
            <option value="0">根目录</option>
              <?foreach ($school_list as $val)
                  {
                      echo '<option value="'.$val['nid'].'">'.$val['name'].'</option>';

                      foreach ($val[$val['name']] as $val2)
                      {
                          echo '<option value="'.$val2['nid'].'">'.$val['name']. ' > '.$val2['name'].'</option>';
//                          没有第四级，不出这个循环
//                          foreach ($val2[$val2['name']] as $val3)
//                          {
//                              echo '<option value="'.$val3['nid'].'"> &nbsp; &nbsp; '.$val3['name'].'</option>';
//                          }

                      }
                  }?>

          </select>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">位置</label>
        <div class="layui-input-block">
            <input type="text" name="location" placeholder="请输入部门位置" autocomplete="off" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">电话</label>
        <div class="layui-input-block">
            <input type="text" name="phone" placeholder="请输入部门电话" autocomplete="off" class="layui-input">
        </div>
    </div>



    <div class="layui-form-item">
        <label class="layui-form-label">建立日期</label>
        <div class="layui-input-block">

            <input type="text" name="builddate" id="date" autocomplete="off"  placeholder="请输入建立日期"
                   class="layui-input laydate laydate-icon"
                   value="<? echo date("Y-m-d")  ?>" />
        </div>
    </div>




    <?
    $agean_list=select_lines_all_items($table_Prefix."employee","mid asc,nid desc","","0");
	
    ?>

    <div class="layui-form-item">
        <label class="layui-form-label">负责人</label>
        <div class="layui-input-block">
            <select name="principal" lay-search="" >
                <option value="">直接输入工号或者名字可以快速选择</option>
                <? for($i=0;$i<count($agean_list);$i++){ ?>
                    <option value="<? echo $agean_list[$i]['nid'] ?>"><? echo $agean_list[$i]['mid'] ?> : <? echo $agean_list[$i]['name'] ?></option>
                <? } ?>
            </select>
        </div>
    </div>




    <div class="layui-form-item" style="display: none">
        <label class="layui-form-label">当前状态</label>
        <div class="layui-input-block">
            <input type="radio" name="status" value="启用" title="启用" checked>
            <input type="radio" name="status" value="关闭" title="关闭" >
        </div>
    </div>


  
    <div class="layui-form-item layui-form-text">
    <label class="layui-form-label">备注</label>
    <div class="layui-input-block">
      <textarea name="remark" placeholder="备注" class="layui-textarea"></textarea>
    </div>
  </div>

  <div class="function">
    <div class="layui-input-block">
      <button class="layui-btn" lay-submit lay-filter="formMemberAdd" type="submit">立即提交</button>
      <button type="reset" class="layui-btn layui-btn-primary">重置</button>
    </div>
  </div>
</form>




 
 
        </div>
            	</div>
        	</div>
    	</div>
	</div>

</div>


<script>
layui.use('form', function(){
  var form = layui.form;
  
  //各种基于事件的操作，下面会有进一步介绍
});
</script>
<!--底部栏-->
<?php include ROOT_PATH_ . "/controller/common/module/footer.php"; ?>
</body>
</html>

